#ifndef MAINWINDOW_IMPL_H
#define MAINWINDOW_IMPL_H

#include <QMainWindow>
#include <QGroupBox>
#include <QPushButton>
#include <QProgressBar>
#include <QLabel>
#include <QLineEdit>
#include <QTextEdit>
#include <QString>
#include <QStatusBar>
#include <QMessageBox>
#include <QComboBox>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public: /* widgets */
    QWidget *centralWidget;
    QWidget *leftWidget;
    QWidget *rightWidget;

    QGroupBox *settingGroup;
    QGroupBox *deviceGroup;
    QGroupBox *commandGroup;
    QGroupBox *deviceLogGroup;

    // settingGroup
    QLabel *serialPortLabel;
    QComboBox *serialPortComboBox;
    QLabel *baudRateLabel;
    QComboBox *baudRateComboBox;
    QPushButton *opSerialPortBtn;
    QPushButton *refreshSerialPortBtn;

    // deviceGroup
    QPushButton *readFirmBtn;
    QPushButton *upgradeFirmBtn;
    QPushButton *readVersionBtn;
    QPushButton *resetBtn;
    QPushButton *readUUIDBtn;
    QPushButton *setKeyBtn;
    QPushButton *readConfigBtn;
    QPushButton *setConfigBtn;
    QProgressBar *progressBar;

    // commandGroup
    QLineEdit *commandInput;
    QPushButton *sendCommandBtn;
    QTextEdit *commandDisplay;

    // deviceLogGroup
    QTextEdit *deviceLogDisplay;

private: /* internal functions */
    void widgetsInit();
    void layoutInit();
    void logMenuInit(const QString &title, QTextEdit* textEdit);
};

#endif // MAINWINDOW_IMPL_H
